<template>

  <el-row>
    <el-col :span="2"><span class="f1">今日已看诊{{0}}人</span></el-col>
    <el-col :span="2"><span class="l2">当前有{{0}}人排队</span></el-col>

  </el-row>
  <el-row>
    患者叫号
  </el-row>
  <el-row>
    <table class="rt">
      <tr>
        <td>
          <el-input v-model="caseNumber" placeholder="请输入患者病例号"></el-input>
        </td>
        <td>
          <el-input v-model="realName" placeholder="请输入患者姓名"></el-input>
        </td>
        <td>
          <el-button @click="search" type="primary">搜索</el-button>
        </td>
      </tr>
    </table>
  </el-row>
  <el-row>
    <el-table :data="callList">
      <el-table-column label="编号" prop="id"></el-table-column>
      <el-table-column label="患者姓名" prop="realName"></el-table-column>
      <el-table-column label="患者病例号" prop="caseNumber"></el-table-column>
      <el-table-column label="操作">
         <template #default="scope">
          <el-button @click="goPatient(scope.row)" >创建病例</el-button>
           <el-button>叫号</el-button>
           <el-button @click="go2Patient(scope.row)">检验申请</el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-row>
  <el-row>
    <el-pagination></el-pagination>
  </el-row>
</template>

<script>
export default {
  name: "call",
  data(){
    return{

      caseNumber:'',
      realName:'',

      callList:[]
    }
  },
  methods:{
    goPatient(row){
        // this.$router.push({path:'/home/outpatient/homepage',query:{r:JSON.stringify(row)}})
      sessionStorage.setItem("r",JSON.stringify(row))
      this.$router.push('/home/outpatient/homepage')
    },
    go2Patient(row){
      // this.$router.push({path:'/home/outpatient/homepage',query:{r:JSON.stringify(row)}})
      sessionStorage.setItem("r",JSON.stringify(row))
      this.$router.push('/home/outpatient/test')
    },
    search(){
      let eid =this.$store.state.emp.id

          this.$axios.get("http://localhost:8080/register/list?employyId="+eid+"&caseNumber="+this.caseNumber+"&realName="+this.realName).then((res) => {


             this.callList=res.data


          })
    }
  }
}
</script>

<style scoped>
*{
  text-align: left;
  font-size: 14px;
}
.el-row:nth-child(1){
  border: none;
  margin:0px;
  padding:0px;
}
.el-row:nth-child(1) span{
  display: inline-block;
  line-height: 30px;
}
.f1{
  background-color: #F0F9EB;
  color: #67C23A;
}
.l2{
  background-color: #FDF6EC;
  color: #E7AAA8;
}


.el-row{
  border-top: solid 1px lightgray;
  line-height: 60px;
}

.rt{
  width: 60%;
  text-align: left;
  color: #909399;
}
.rt .el-input{
  height: 40px;
  width: 95%;
}
</style>